#include <iostream>
#include <vector>
#include <stream>


class MyCircularQueue {
private:
    int front;
    int rear;
    int capacity;
    int size;
    vector<int> elements;
//capacity:4;
// 0 , 1 , 2,
public:
    MyCircularQueue(int k) {
        this->capacity = k;
        this->elements.reserve(this->capacity);
        this->rear =-1;
        this->front =0;
        this->size = 0;
    }

    bool enQueue(int value) {
        if(this->size==this->capacity){
            return false;
        }
        ++size;
        this->rear=(this->rear+1)%(this->capacity);
        this->elements[this->rear]=value;
        return true;
    }

    bool deQueue() {
        if(this->size==0){
            return false;
        }
        --size;
        auto front_value= this->elements[this->front];
        this->front=(this->front+1)%(this->capacity);
        return true;
    }

    int Front() {
        if(this->size==0){
            return -1;
        }
        return this->elements[this->front];
    }

    int Rear() {
        if(this->size==0){
            return -1;
        }
        return this->elements[this->rear];
    }

    bool isEmpty() {
        if(this->size==0){
            return true;
        }
        return false;
    }

    bool isFull() {
         if(this->size==this->capacity){
            return true;
        }
        return false;
    }
};